import request from '@/utils/request'

function filterNUll(d) {
  let param2 = {};
  for (let k in d){
    // console.log(d[k])
    if(d[k] != null){
      param2[k] = d[k];
    }
  }
  return param2;
}

function makeParams(d) {
  var list = []
  var paramList = Object.entries(d);
  for (let k in paramList){
      // console.log(k, paramList[k]);
      list.push(`${paramList[k][0]}=${paramList[k][1]}`);
  } 
  return list.join("&")
}

// 查询 Hs6 编码
export function queryHs6(params) {
  let p = filterNUll(params)
  let query = makeParams(p)

  return request({
      url: `/bigdata/demo/quanqiu/queryHs6?${query}`,
      method: 'get',
  })
}

// 获取 种羊场 列表
export function getFarmList() {
  return request({
      url: `/getFarmList`,
      method: 'get',
  })
}